package uk.co.revisual.domino.controller.cmaps
{
	import org.puremvc.as3.multicore.patterns.observer.Notifier;
	
	import uk.co.revisual.cmaps.BaseCMap;
	import uk.co.revisual.domino.consts.DominoConsts;
	import uk.co.revisual.domino.controller.cmds.ExecuteCommandClassCmd;
	import uk.co.revisual.domino.controller.cmds.OnStateActionCmd;
	import uk.co.revisual.domino.controller.cmds.OnStateChangedCmd;
	import uk.co.revisual.domino.controller.cmds.OnStateTransitionCancelledCmd;
	import uk.co.revisual.domino.core.FSMNotificationNames;

	public class DominoCmdMap extends Notifier
	{
		public function DominoCmdMap():void{
			
		}
		public function occupy():void
		{
			facade.registerCommand(	DominoConsts.INTERNAL.CHANGED, OnStateChangedCmd );
			facade.registerCommand(	FSMNotificationNames.ACTION, OnStateActionCmd );
			facade.registerCommand(	FSMNotificationNames.CANCEL, OnStateTransitionCancelledCmd );
			facade.registerCommand(	DominoConsts.EVENT_NODES_NAMES.ENTERING_GUARD, ExecuteCommandClassCmd );
			facade.registerCommand(	DominoConsts.EVENT_NODES_NAMES.EXITING_GUARD, ExecuteCommandClassCmd );
		}
		
		public function vacate():void
		{
			facade.removeCommand( DominoConsts.INTERNAL.CHANGED );
			facade.removeCommand( FSMNotificationNames.ACTION );
			facade.removeCommand( FSMNotificationNames.CANCEL );
			facade.removeCommand( DominoConsts.EVENT_NODES_NAMES.ENTERING_GUARD );
			facade.removeCommand( DominoConsts.EVENT_NODES_NAMES.EXITING_GUARD );
		}
		
	}
}